package service.impl;

import bean.Student;
import dao.StudentDao;
import dao.impl.StudentDaoImpl;
import service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {

    private StudentDao studentDao;

    public void setStudentDao(StudentDao studentDao) {
        this.studentDao = studentDao;
    }

    public List<Student> list() {
        List<Student> studentList = studentDao.queryAll();
        return studentList;
    }

    public void add(Student student) {
        studentDao.add(student);
    }

    public void delete(int id) {
        studentDao.delete(id);
    }

    public Student queryOne(int id) {
        Student student = studentDao.queryOne(id);
        return student;
    }


}
